package com.chartdemo;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.chartdemo.data.JsonStr;

public class ChartDemo extends Activity implements OnClickListener
{
	/**
	 * 圆柱图
	 */
	private Button column;
	/**
	 * 曲线图
	 */
	private Button curve;
	/**
	 * 饼图
	 */
	private Button pie;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		setContentView(R.layout.activity_chart_demo);
		column = (Button) findViewById(R.id.column);
		curve = (Button) findViewById(R.id.curve);
		pie = (Button) findViewById(R.id.pie);
		
		column.setOnClickListener(this);
		curve.setOnClickListener(this);
		pie.setOnClickListener(this);
	}
	
	public void column()
	{
		Intent intent = new Intent(ChartDemo.this, ColumnChartDemo.class);
		startActivity(intent);
	}
	
	public void curve()
	{
		Intent intent = new Intent(ChartDemo.this, CurveChartDemo.class);
		startActivity(intent);
	}
	
	public void pie()
	{
		Intent intent = new Intent(ChartDemo.this, PieChartDemo.class);
		startActivity(intent);
	}
	
	@Override
	protected void onDestroy()
	{
		super.onDestroy();
	}
	
	@Override
	public void onClick(View v)
	{
		switch (v.getId())
		{
			case R.id.column:
				this.column();
				break;
			case R.id.curve:
				this.curve();
				break;
			case R.id.pie:
				this.pie();
				break;
		}
	}
}
